Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Sass from upstream #443

Merged
merged 9 commits into from
Apr 24, 2024
Merged

Backport Sass from upstream #443

merged 9 commits into from
Apr 24, 2024

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Mar 25, 2024

@XhmikosR XhmikosR force-pushed the xmr/scss branch 2 times, most recently from 7b17702 to e991979 Compare March 25, 2024 12:53
@XhmikosR XhmikosR marked this pull request as ready for review March 25, 2024 12:56
padding: 12px 12px 12px 154px;
margin: 1.5rem auto 0;
padding: 15px 15px 15px 160px;
margin: 2rem 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the surrounding HTML code is different in the blog, but margin: 2rem 0; causes a regression making the ad not horizontally centered at some breakpoints:

Screenshot 2024-04-03 at 09 04 52

The easiest fix would be to do margin: 2rem auto 0; instead.

If we want exactly the same Scss file, we should rather dig into the HTML structure surrounding the ad "component".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to push your changes as always

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your preferred approach? Having exactly the same Sass file for an easier maintenance?

Copy link
Member

@julien-deramond julien-deramond Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took time to dig into this topic in detail and pushed 5febd28 to fix the issue.

We've gathered upstream _ad.scss as is. However, upstream, there's an extra rule for #carbonads in site/assets/scss/_masthead.scss:

#carbonads { // stylelint-disable-line selector-max-id
  margin-inline: auto;
}

Ads are displayed in different contexts upstream so that an extra rule is not always needed. For the blog, it must be used. So I've added the extra auto directive and added a comment to try to show that this is specific.
You can remove or reword this comment the way you think it's going to be the most helpful in terms of maintenance; our future selves should understand at some point the following:

  • blog: _ad.scss = upstream: _ad.scss + extra auto rule.

src/assets/scss/_buttons.scss Outdated Show resolved Hide resolved
src/assets/scss/_buttons.scss Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, some classes defined in this document are not used in the blog, such as .custom-tooltip and .custom-popover.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but I'd rather keep the used files as closed as possible. Alternatively, we can comment out the unused crap and add a comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got no problem with that, just wanted to spot it in case you weren't aware of it.

@XhmikosR
Copy link
Member Author

@julien-deramond do you want to make any further changes here?

@julien-deramond julien-deramond self-requested a review April 24, 2024 11:48
Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julien-deramond do you want to make any further changes here?

Sorry for the delay, I was off for some time. I've checked the last modifications, I think we're good. Nice PR 👌

@XhmikosR XhmikosR merged commit 54e7e29 into main Apr 24, 2024
8 checks passed
@XhmikosR XhmikosR deleted the xmr/scss branch April 24, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants